<?php
/**
 * 院校MBA库管理后台列表页
 * BY HehongChen
 * 2014.10.14
 */
require_once(dirname(__FILE__).'/config.php');
require_once(DEDEINC.'/datalistcp.class.php');
require_once(DEDEINC.'/enums.func.php');
// 设置跳转返回的链接
setcookie('ENV_GOBACK_URL', $dedeNowurl, time()+3600, '/');

// 搜索部分
if(empty($keyword)) $keyword = '';
$search = '1';
if ($search_area!='0'&&!empty($search_area)) {
	$search .= " AND area = $search_area";
}
if ($search_feerange!='0'&&!empty($search_feerange)) {
	$search .= " AND feeRange = $search_feerange";
}
if ($search_projecttype!='0'&&!empty($search_projecttype)) {
	$search .= " AND FIND_IN_SET($search_projecttype,projectType)";
}

$sql = "SELECT * FROM `#@__collegeinfo` WHERE  name LIKE '%$keyword%' AND $search";

$dlist = new DataListCP();
$dlist->SetParameter('keyword', $keyword);
$dlist->SetParameter('search_area', $search_area);
$dlist->SetParameter('search_feerange', $search_feerange);
$dlist->SetParameter('search_projecttype', $search_projecttype);
$dlist->SetTemplet(DEDEADMIN.'/templets/collegeinfo_list.htm');
$dlist->SetSource($sql);
$dlist->display();

// 对学费前台样式进行处理
function DealFee($lowet_fee,$highest_fee){
	$fee = '';
	if (!$lowet_fee) {
		$lowet_fee = 0;
	}
	$fee = $lowet_fee.'万';
	if ($highest_fee) {
		$fee .= '-'.$highest_fee.'万';
	}
	return $fee;
}

/**
 * 处理联动菜单值多个的情况
 * $egroup 为联动组
 * $evalue 为联动值，多个联动值的用","分隔
 */
function deal_multivalue($egroup,$evalue){
	$arr_value = explode(',', $evalue);
	$str_value = "";
	foreach ($arr_value as $key => $value) {
		$str_value .= GetEnumsValue($egroup,$value).','; 
	}
	$str_value = rtrim($str_value,',');
	return $str_value;
}

?>